//
//  CYMeTool.h
//  CreditAddressBook
//
//  Created by Lee on 15/9/18.
//  Copyright © 2015年 Lee. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CYHttpTool.h"
@class CYCloudPerson;

@interface CYMeTool : NSObject

/**
 *  添加一个联系人到系统通讯录
 *
 *  @param person
 *
 *  @return
 */
+ (BOOL)addABPerson:(CYCloudPerson *)person;

/**
 *  添加N个联系人到系统通讯录
 *
 *  @param persons
 *  @param success  添加成功的persons
 *  @param failure  添加失败的persons
 */
+ (void)addABPersons:(NSArray *)persons success:(void (^)(NSArray *arr))success failure:(void (^)(NSArray *arr))failure;

/**
 *  删除一个系统通讯录联系人
 *
 *  @param person
 *
 *  @return
 */
+ (BOOL)deleteABPerson:(CYCloudPerson *)person;

/**
 *  删除N个系统通讯录联系人
 *
 *  @param persons
 *  @param success  删除成功的persons
 *  @param failure  删除失败的persons
 */
+ (void)deleteABPerson:(NSArray *)persons success:(void (^)(NSArray *arr))success failure:(void (^)(NSArray *arr))failure;

/**
 *  处理云同步contacts参数
 */
+ (NSArray *)contactsArr;

/**
 *  云同步
 */
+ (void)cloudSynWithSuccess:(void(^)(id json))Success failure:(HttpRequestFailure)failure uploadProgress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))block;

/**
 *  后台云同步
 */
+ (void)backgroundCloudSyn;
@end
